package com.fpt.edu.vn.h2tv.dao.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TbComment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tb_comment", catalog = "bookdb")
public class TbComment implements java.io.Serializable {

	// Fields

	private Integer commentid;
	private TbBook tbBook;
	private TbAccount tbAccount;
	private String comment;
	private Timestamp createtime;
	private Timestamp updatetime;

	// Constructors

	/** default constructor */
	public TbComment() {
	}

	/** full constructor */
	public TbComment(Integer commentid, TbBook tbBook, TbAccount tbAccount,
			String comment, Timestamp createtime, Timestamp updatetime) {
		this.commentid = commentid;
		this.tbBook = tbBook;
		this.tbAccount = tbAccount;
		this.comment = comment;
		this.createtime = createtime;
		this.updatetime = updatetime;
	}

	// Property accessors
	@Id
	@Column(name = "COMMENTID")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getCommentid() {
		return this.commentid;
	}

	public void setCommentid(Integer commentid) {
		this.commentid = commentid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BOOKID", nullable = false)
	public TbBook getTbBook() {
		return this.tbBook;
	}

	public void setTbBook(TbBook tbBook) {
		this.tbBook = tbBook;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USERID", nullable = false)
	public TbAccount getTbAccount() {
		return this.tbAccount;
	}

	public void setTbAccount(TbAccount tbAccount) {
		this.tbAccount = tbAccount;
	}

	@Column(name = "COMMENT", nullable = false, length = 65535)
	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Column(name = "CREATETIME", nullable = false, length = 19)
	public Timestamp getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	@Column(name = "UPDATETIME", nullable = false, length = 19)
	public Timestamp getUpdatetime() {
		return this.updatetime;
	}

	public void setUpdatetime(Timestamp updatetime) {
		this.updatetime = updatetime;
	}

}